<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateOrgaoUsinaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <p:growl id="messages" life="3000"/>
                
                <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
                </h:panelGroup>

                <p:panel>

                    <f:facet name="header">
                        <h:outputText value="#{bundle.LegendOrgaoUsinaTitle}"></h:outputText>
                    </f:facet>

                    <h:panelGrid columns="2">
                        <ui:remove>
                            <h:outputLabel value="#{bundle.CreateOrgaoUsinaLabel_ousId}" for="ousId" />
                            <p:inputText id="ousId" value="#{orgaoUsinaController.selected.ousId}" title="#{bundle.CreateOrgaoUsinaTitle_ousId}" required="true" requiredMessage="#{bundle.CreateOrgaoUsinaRequiredMessage_ousId}"/>
                        </ui:remove>
                        <h:outputLabel value="#{bundle.CreateOrgaoUsinaLabel_ousUsiId}" for="ousUsiId" />
                        <h:selectOneMenu id="ousUsiId" value="#{orgaoUsinaController.selected.ousUsiId}" title="#{bundle.CreateOrgaoUsinaTitle_ousUsiId}" >
                            <f:selectItems value="#{usinaController.itemsAvailableSelectOne}"/>
                            <p:focus for="ousUsiId"/>
                        </h:selectOneMenu>
                        <h:outputLabel value="#{bundle.CreateOrgaoUsinaLabel_ousOrgId}" for="ousOrgId" />
                        <h:selectOneMenu id="ousOrgId" value="#{orgaoUsinaController.selected.ousOrgId}" title="#{bundle.CreateOrgaoUsinaTitle_ousOrgId}" >
                            <f:selectItems value="#{orgaoController.itemsAvailableSelectOne}"/>
                        </h:selectOneMenu>
                    </h:panelGrid>
                    <br/>
                    <p:commandButton ajax="false" icon="ui-icon-disk" action="#{orgaoUsinaController.create}" value="#{bundle.CreateOrgaoUsinaSaveLink}" /> &nbsp;
                    <p:commandButton ajax="false" action="#{orgaoUsinaController.prepareList}" value="#{bundle.CreateOrgaoUsinaShowAllLink}" immediate="true"/>                    

                </p:panel>
            </h:form>
            <br/>
            <ui:include src="Lista.xhtml"/>
        </ui:define>

    </ui:composition>

</html>
